
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DRIVER_PBS_03JN_H__
#define __DRIVER_PBS_03JN_H__

#include "stm32f4xx_hal.h"

#ifdef __cplusplus
 extern "C" {
#endif
   
#define PBS03JN_NO_OBS          (0)
#define PBS03JN_WARN_YELLOW     (1)
#define PBS03JN_WARN_ORANGE     (2)
#define PBS03JN_WARN_RED        (3)
#define PBS03JN_WARN_ERROR      (4)
// Set Area, NOTE: 0 <= area <= 15,   When area==0 ==> Emission stop
void PBS03JN_SetArea(unsigned char channel, unsigned char area);

// Get Current Output, return:
// 0 -No Obstacle detected
// 1 -Obstacle detected in current area, distance < farthest range
// 2 -Obstacle detected in current area, distance < middle   range
// 3 -Obstacle detected in current area, distance < nearest  range
// 4 -Trouble
unsigned int PBS03JN_GetOutput(unsigned char channel);

void PBS03JN_SetIOValue(unsigned char channel, unsigned char value);
unsigned char ReadInput1Loop(unsigned char channel);
unsigned char ReadInput2Loop(unsigned char channel);
unsigned char ReadInput3Loop(unsigned char channel);
unsigned char ReadInput4Loop(unsigned char channel);

//int getObstacleStatus(void);


#ifdef __cplusplus
}
#endif

#endif